A vector graph is a geometrical graph described by a series of coordinate points and having a specific shape and attribute. FLASH, which is an animation format of a vector graph, defines the graph primarily as a line and area. Particularly, the line depicts a contour of a shape of the graph, and the area refers to an enclosed scope defined in the contour of the shape. Drawing of a FLASH vector graph primarily involves filling of the area. In FLASH, an area is defined by various interlaced colors, and lines defining the contour of the area include straight lines and curves. For a uniform filling algorithm, the area has to be segmented into a series of monochromatic polygons prior to being filled and is filled by filling the polygons.
Filling of a polygon is a computation-intensive process, each operation of which requires a considerable computation resource, thus requiring a great processing capacity of a Central Processing Unit (CPU). The process includes coordinate transformation of vertexes of the polygon, tailoring of the polygon with respect to a drawing window, conversion of the polygon into scan lines in the drawing window and coloring of the scan lines.
Referring to FIG. 1, a specific flow of filling a polygon in the prior art is as follows.
Operation 101: a vector graph is parsed into a series of polygons.
Operation 102: vertex coordinates of each polygon are transformed through a matrix operation, to map the polygon into a drawing window, where vertex coordinates of the polygon are in 1/20 pixel.
Operation 103: the polygon is tailored with respect to the drawing window into a polygon in the drawing window.
Operation 104: a scan conversion algorithm is applied to convert the polygon in the drawing window into a set of scan lines in the drawing window.
Operation 105: pixels covered by each scan line are colored, where coordinates of intersections of the scan lines are divided by 20 into coordinate values in pixel in the drawing window during coloring.
In the foregoing filling process, vertex coordinates of a polygon are in 1/20 pixel, all operations, before the operation 105 of coloring pixels covered by each scan line, have to be performed with a coordinate in 1/20 pixel, and then during coloring of the pixels, the coordinates of the intersections of the converted scan lines are divided by 20 into coordinate values in pixel in the drawing window. The division operation performed by a CPU is very time-consuming and consumes a considerable CPU resource, thus requiring a great processing capacity of the CPU.